package com.hiof.overlays;

import com.google.android.maps.GeoPoint;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;

public class OverlayUtils {
	public static boolean isInsideCanvas(Canvas canvas, int x, int y) {
		return (x >= 0 && x <= canvas.getWidth() && y >= 0 && y <= canvas
				.getHeight());
	}

	public static void drawMarker(Canvas canvas, int id, Resources resources,
			int x, int y) {
		Bitmap bitmap = BitmapFactory.decodeResource(resources, id);
		canvas.drawBitmap(bitmap, x - 10, y - 10, null);
	}
    /*
	public static void drawRadar(Canvas canvas, int id, Resources resources, int x,
			int y, GeoPoint locationPoint) {
		float intersectionPoints[] = IntersectionPointUtils
				.getOverlayDrawablePoint(canvas.getWidth() / 2, x, canvas
						.getHeight() / 2, y, canvas.getWidth(), canvas
						.getHeight());

		Bitmap bitmap = BitmapFactory.decodeResource(resources, id);
		Paint p = new Paint(Paint.ANTI_ALIAS_FLAG);
		p
				.setAlpha(IntersectionPointUtils.getPixelsAlphaValue(
						(int) intersectionPoints[0], x,
						(int) intersectionPoints[1], y));

		int w = bitmap.getWidth();
		int h = bitmap.getHeight();
		Matrix mtx = new Matrix();
		float rotation = IntersectionPointUtils.getRotationAngleDegrees(canvas.getWidth() / 2, x,
				canvas.getHeight() / 2, y);
		mtx.postRotate(rotation);
		Bitmap rotatedBMP = Bitmap.createBitmap(bitmap, 0, 0, w, h, mtx, true);
		canvas.drawBitmap(rotatedBMP, intersectionPoints[0],
				intersectionPoints[1], p);
	}*/
}
